/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import connectivity.QueryManager;
import main.WinkelApplication;
/**
 *
 * @author shiro
 * Creates an employee, extending the User
 */
public class Employee extends User{
    //Constructor
    public Employee(){
       //Left blank intentionally. //
    }
   //Constructs an Employee with the given information.
    public Employee(int userID, int roleID, String firstname, String lastname, String username, String password){
        setFirstname(firstname);
        setLastname(lastname); 
        setRoleId(roleID);
        setPassword(password);
        setUsername(username);
        setUserId(userID);
    }
    //Methods
    
    //Adds a customer to the database using given name, adress, postalcode and living area.
//    public void newCustomer(String name, String adress, String postalcode, String livingarea){
//        //create QueryManager
//        QueryManager qm = WinkelApplication.getQueryManager();
//        //Create an user object to be passed on to the queryManager.
//        Customer customer = new Customer();
//        customer.setKlantId(qm.getHighestCustomer() + 1);
//        customer.setNaam(name);
//        customer.setWoonplaats(livingarea);
//        customer.setPostcode(postalcode);
//        customer.setAdres(adress);
//        //Add customer to DB.
//        qm.addCustomer(customer);
//    }
    //pull an existing customer from the database, replace old information with new info, and throw it back at the database.
//        public void editCustomer(int klantId, String name, String Adress, String livingArea, String postalCode){
//        QueryManager qm = WinkelApplication.getQueryManager();
//        Customer customerToEdit = qm.getCustomer(klantId);
//        customerToEdit.setAdres(Adress);
//        customerToEdit.setNaam(name);
//        customerToEdit.setWoonplaats(livingArea);
//        customerToEdit.setPostcode(postalCode);
//        qm.updateCustomer(customerToEdit);        
//    }
//    newOrder already handled by interface.
//    public void newOrder(){
//        
//    }
    
//    public void changeOrder(int orderID, Customer customer, String notes, String pMethod){
//        QueryManager qm = WinkelApplication.getQueryManager();
//        Order order = qm.getOrderByID(orderID);
//        order.setCustomer(customer);
//        order.setNotes(notes);
//        order.setPaymentMethod(pMethod);
//        
//    }
//    
//    public void deleteOrder(int orderID){
//        QueryManager qm = WinkelApplication.getQueryManager();
//        qm.deleteOrderByID(orderID);
//    }
}
